
export const sendMessage = async (message: any) => {
    return await browser.runtime.sendMessage(message)
}

export const localStorage = ()=>{
    return browser.storage.local
}

export const localSave = async (key: string, value: any)=>{
    let data = await browser.storage.local.get([key]);
    if (!data) {
        data = {}
    }
    if (!data[key]) {
        data[key] = {}
    }
    Object.assign(data[key], value)
    browser.storage.local.set(data)
}